#include<iostream>
#include<chrono>
using namespace std;
using namespace chrono;

int main(){
	auto start = system_clock::now();
	int sum =0;
	for(int i=0;i<1000;++i){
		sum +=i;
	}
	auto end = system_clock::now();
	auto timeSpend = duration_cast<microseconds>(end-start);
	cout<<"sum = "<<sum<<"耗时"<<double(timeSpend.count())*microseconds::period::num/microseconds::period::den<<"秒"<<endl;
	return 0;
}
